//
//  network_type.h
//  testpcap
//
//  Created by bugforever on 1/11/15.
//  Copyright (c) 2015 bugforever. All rights reserved.
//

#ifndef __network_type_h
#define __network_type_h

#define _XKEYCHECK_H

#ifdef _WIN32
#include "../ThirdParty/WpdPack/Include/pcap.h"
#else
#include "../ThirdParty/libpcap-1.6.2/pcap.h"
#endif

enum FILTER_ACCEPT_DATATYPE
{
    FAD_UNKNOWN = 0,
    FAD_PCAP,
    FAD_ETHERNET,
    FAD_ARP,
    FAD_RARP,
    FAD_IP,
    FAD_UDP,
    FAD_TCP,
    FAD_HTTP,
    
    FAD_MAX = 0XFFFFFFFF,
};



enum PCAP_LINKTYPE
{
    LINKTYPE_NULL = 0,
    LINKTYPE_ETHERNET = 1,
    
    LINKTYPE_MAX = 0XFFFFFFFF,
};

#define ETHERTYPE_IPV4          0x0800 /* ipv4 protocol */
#define ETHERTYPE_ARP           0x0806 /*ARP protocol*/
#define ETHERTYPE_RARP          0x8035 /*RARP protocol*/
#define ETHERTYPE_IPV6          0x86DD /* ipv6 protocol */


//refer to https://www.ietf.org/rfc/rfc790.txt
#define IPPROTOCOL_ICMP         0x0001 /*ICMP*/
#define IPPROTOCOL_TCP          0x0006 /*TCP*/
#define IPPROTOCOL_UDP          0x0011 /*UDP*/

#define IP_SUBTYPE_RAW          0x0001
#define IP_SUBTYPE_DETAIL       0x0002
#define IP_SUBTYPE_DEFRAGMENTED 0X0003

#endif
